<?php
include "partial/all-template.php";
?>
<script type="text/html" id="module-name">people/profile</script>

<div class="cover-photo">
    <img style="height: 250px; width: 100%" class="img-rounded" alt=""
         src="/img/aditya-mega-city.jpeg">
</div>

<div id="userId" data-userid="<?php echo $this->user['id']; ?>"></div>
<div class="users-main row">

    <div class="col-lg-3 col-md-3 users-info">

        <div class="profile-photo" style="min-height: 60px;">
            <img
                style="position: absolute; max-width: 80%; margin-top: -100px; margin-left: 20px;max-height:150px;"
                class="img-rounded" alt=""
                src="/Image/getUserImage?id=<?php echo $this->user['photoarray']['profile']['id']; ?>">
        </div>

        <div class="info" style="margin-left: 20px;">
            <label> <span style=" text-transform: capitalize;"
                          class="prominent camelcase"> <?php echo $this->user['name'] ?> </span> </label> <br/>

            <?php if ($this->user['renter'] == 1) { ?>
                <label> <span style="color: #808080;"
                              class="prominent"> -  Living as <a href="/allRenter"> Renter </a> </span> </label> <br/>

            <?php } else { ?>

                <label> <span style="color: #808080;"
                              class="prominent"> - Living as <a href="/allOwner"> Owner </a> </span> </label> <br/>
            <?php } ?>

        </div>


    </div>
    <div class="col-lg-7 col-md-9 users-activity" style="padding:10px;">

        <div class="panel panel-default users-menu js_body">
            <div class="panel-heading">
                <ul class="nav nav-pills js_menu">
                    <li><a data-module="about" class="hmenu selected js_menu_item" href="javascript:">About </a></li>
                    <?php if($this->user['id'] != $this->curUser['id']) {  ?>
                    <li><a data-module="message" class="hmenu js_menu_item" href="javascript:">Send Message </a></li>
                    <li><a data-module="block" data-userId="<?php echo $this->user['id'];?> " class="hmenu js_menu_item" href="javascript:">Block User </a></li>

                    <?php } ?>
                </ul>
            </div>
            <div class="panel-body">
                <div class="js_about js_child">
                    <p>
                    <blockquote><?php echo $this->user['aboutMe'] ?> </blockquote>
                </
                </p>
                <label>
                    <span class="grey"> Flat No.  </span> <span
                        class="prominent">  <?php echo $this->user['flatNumber'] ?></span>
                </label>
                <br/>
                <label>
                    <span class="grey">  Block : </span> <span
                        class="prominent"> <?php echo array_reduce($this->user['groups'], function ($carry, $item) {
                            if ($item['type'] === 'block') {
                                $carry = $carry . $item['name'];
                            }
                            return $carry;
                        }, ''); ?> </span>
                </label>
                <br/>
                <label>
                    <span class="grey"> Apartment : </span><span
                        class="prominent"><?php echo array_reduce($this->user['groups'], function ($carry, $item) {
                            if ($item['type'] === 'apartment') {
                                $carry = $carry . $item['name'];
                            }
                            return $carry;
                        }, ''); ?> </span>
                </label>

                <br/>
                <label>
                    <span class="grey"> Email :</span> <span
                        class="prominent"> <?php echo $this->user['email']; ?> </span>
                </label>

                <br/>
                <label>
                    <span class="grey"> Phone :</span> <span
                        class="prominent"> <?php echo $this->user['phone']; ?> </span>
                </label>
                <br/>
                <label>
                    <span class="grey"> Profession :</span> <span
                        class="prominent"> <?php echo $this->user['profession']; ?> </span>
                </label>
                <br/>
                <?php if ($this->user['post']) { ?>
                    <label>
                        <span class="grey"> Post :</span> <span
                            class="prominent"> <?php echo $this->user['post']; ?> </span>
                    </label>
                    <br/>
                <?php } ?>
            </div>


            <div class="js_message js_child" style="display: none;">
                <div>
                    <div>

                        <div class="input-placeholder fakeInput" id="updateInput">Click to
                            message ...
                        </div>
                    </div>
                    <div style="display: none" class="panel-footer">
                        <div class="panel-footer" style="">
                            <button class="btn btn-primary btn-sm submit" title="whole apartment will be updated.
						If you have to update only to your block or to some specific people, please use dropdown button next to it.">
                                Send
                            </button>
                            <div class="btn-group" style="display: none;">
                                <button type="button" class="btn btn-sm btn-info dropdown-toggle"
                                        data-toggle="dropdown">
                                    <span class="selection"> Your Apartment </span> <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu" role="menu">

                                    <!--
                                    <li><a href="javascript:" data-index="1">Your Apartment</a></li>
                                    <li><a href="javascript:" data-index="2">Your Block</a></li>
                                    -->
                                </ul>
                            </div>
                            <a href="javascript:" title="rich text option"
                               class="js_showfont hourable"> <span style=""
                                                                   class="glyphicon glyphicon-font "> </span>
                            </a>
                            <a href="javascript:" title="Upload file" style="display: none;"
                               class="js_fileupload hourable">
                                <span style="" class="glyphicon glyphicon-plus"></span>
                            </a> <input type="file" style="display: none;">
                            <button class="btn btn-default btn-sm cancel" style="float: right">Cancel</button>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
</div>
<?php
$env = getenv('APP_ENV') ?: 'production';
if($env != 'production') {
    echo '<script data-main="/js/app" src="/js/lib/require.js"></script>';
}
?>